package com.hwl.server.pojo;


import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AccessLevel;
import lombok.Data;
import lombok.Getter;

import java.io.Serializable;
import java.time.LocalDate;

/**
 * 封装前端的 条件查询 Employee分页数据
 */
@Data
@ApiModel(value = "员工资料首页请求")
public class EmployeePageParam implements Serializable {

    @ApiModelProperty(value = "当前页", required = true)
    private Integer currentPage = 1;

    @ApiModelProperty(value = "页面数据条数", required = true)
    private Integer size = 10;

    @ApiModelProperty(value = "员工姓名")
    private String name;

    @ApiModelProperty(value = "政治面貌")
    private String politicId;

    @ApiModelProperty(value = "民族")
    private String nationId;

    @ApiModelProperty(value = "职位")
    private Integer posId;

    @ApiModelProperty(value = "职称")
    private Integer jobLevelId;

    @ApiModelProperty(value = "聘用形式")
    private String engageForm;

    @ApiModelProperty(value = "部门编号")
    private Integer departmentId;

    @ApiModelProperty(value = "查询范围日期，以逗号分割")
    private String beginDateScope;

    @ApiModelProperty(value = "筛选入职日期的起始范围")
    @Getter(AccessLevel.NONE)
    private String begin;

    @ApiModelProperty(value = "筛选入职日期的最大范围")
    @Getter(AccessLevel.NONE)
    private String end;

    public String getBegin() {
        String[] split = beginDateScope.split(",");
        return split[0];
    }

    public String getEnd() {
        String[] split = beginDateScope.split(",");
        return split[1];
    }

}
